import axios from '@/utils/request'

// 查询企业的部门列表
export const getDepartmentsListAPI = () => {
  return axios({
    url: '/company/department'
  })
}
// 获取员工简单列表
export const getEmployeeSimpleListAPI = () => {
  return axios({
    url: '/sys/user/simple'
  })
}
// 新增部门
export const getAddDepartmentsAPI = (data) => {
  return axios({
    url: '/company/department',
    method: 'POST',
    data: data // 5对key+value的数据对象
  })
}
// 根据ID查询部门详情
export const getDepartmentsDetailAPI = (departId) => {
  return axios({
    url: `/company/department/${departId}`
  })
}
// 根据ID修改部门详情
export const editDepartmentsDetailAPI = (dataObj) => {
  return axios({
    url: `/company/department/${dataObj.id}`,
    method: 'PUT',
    data: dataObj // 9对key+value参数和值对象
  })
}
// 根据ID删除部门
export const delDepartmentsDetailAPI = (departId) => {
  return axios({
    url: `/company/department/${departId}`,
    method: 'DELETE'
  })
}
